﻿@model IEnumerable<VisaApp.Models.HotrotructuyenModel>
           
<script type="text/javascript">
    $(document).ready(function () {
        makeEventDialog("a.addPopupChauluc");
        $("a#deteleCate").click(function () {
            var $this = $(this);
            var CateName = $this.closest('tr').find('.spanNameCate').html();
            if (confirm("Bạn muốn xóa hỗ trợ : " + CateName + "")) {
                var Cateid = $this.closest('tr').find('.Cate-id').html();
                $.get("/Quantri/DeleteHotrotructuyen?id=" + Cateid, function () {
                    $.get("/Quantri/ListHotrotructuyen", function (data) {
                        $("#DivListCate").html("");
                        $("#DivListCate").html(data);
                        alert("xóa chuyên Tin " + CateName + " Thành công");
                    });
                });
            }
        });

    });

</script>

<table width="100%">
    <tr>
        <th>
            Name
        </th>
        <th>
            Nick Skype
        </th>
         <th>
            Nick Yahoo
        </th>
        <th>
            Đt
        </th>
        <th>
            Email
        </th>
        <th>
            Ngày tạo
        </th>
        <th>
            Sửa
        </th>
        <th>
            Xóa
        </th>
    </tr>
    @if (Model != null)
    {
        foreach (var item in Model)
        {
            <tr>
                <td>
                    <span class="Cate-id" style="display:none;">@item.Id</span>
                    <span class="spanNameCate">@item.Name </span>
                </td>
                <td>
                    <span class="spanNameTt">@item.Nick </span>
                </td>
                <td>
                    <span class="spanNameTt">@item.NickYahoo </span>
                </td>
                <td>
                     <span class="spanNameTt">@item.Dt </span>
                 </td>
                  <td>
                     <span class="spanNameTt">@item.Email </span>
                 </td>
                <td>
                    @String.Format("{0:dd/MM/yyy HH:mm}", item.DateCreate)
                </td>
                <td>
                   @Html.ActionLink("Edit", "EditHotrotructuyen", "Quantri", new { id = item.Id }, new { @class = "t-button addPopupChauluc", data_dialog_id = "EditHotrotructuyen", data_dialog_title = "Edit hỗ trợ trực tuyến" })
                </td>
                <td>
                    <a href="javascript:void(0);" class="t-button" id="deteleCate">Xóa</a>
                </td>
            </tr>
        }
    }
</table>

